home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F23238_DisplayProds.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-04  |  1.0 KB  |  31 lines

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.   <xsl:template name="DisplayProds">
  4.     <xsl:param name="ProductNodes" select="." />
  5.       <h1>Product Listing for
  6.       <xsl:value-of select="$ProductNodes//@region" />
  7.       region</h1>
  8.  
  9.       <!--Display the headings for each element as a table header -->
  10.       <table border="1">
  11.         <xsl:for-each select="$ProductNodes//products/product[1]/*">
  12.           <th>
  13.             <xsl:value-of select="name(.)" />
  14.           </th>
  15.         </xsl:for-each>
  16.  
  17.         <!--Display the data for each element as a table row -->
  18.         <xsl:for-each select="$ProductNodes//product">
  19.           <xsl:sort select="prodid" order="ascending" />
  20.           <tr>
  21.             <xsl:for-each select="*">
  22.               <td>
  23.                 <xsl:value-of select="text()" />
  24.               </td>
  25.             </xsl:for-each>
  26.           </tr>
  27.         </xsl:for-each>
  28.       </table>
  29.   </xsl:template>
  30. </xsl:stylesheet>
  31.